<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-form-item .layui-form-label{
            width: 120px;
        }
        .layui-form-item .layui-textarea{
            width: 390px;
        }
        .layui-rate{
          padding-top: 0 !important
        }
        textarea {
           resize: none!important
        }
    </style>
    <script type="text/javascript">

  </script>
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form">

          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>业务信息</legend>
          </fieldset>
          <input type="hidden" name="client_id" value="{$clientInfo.id}" />
          <div class="layui-form-item">
              <label class="layui-form-label">
                 赛事名称
              </label>
              <label class="layui-form-label" style="text-align:left;">
                  {$clientInfo.activity}
              </label>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                 赛事时间
              </label>
              <label class="layui-form-label" style="text-align:left;">
                  {$clientInfo.activity_time}
              </label>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                 客户
              </label>
              <label class="layui-form-label" style="text-align:left;">
                  {$clientInfo.name}
              </label>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                 客户联系方式
              </label>
              <label class="layui-form-label" style="text-align:left;">
                  手机：{$clientInfo.phone}
                  <br>微信：{$clientInfo.wx}
              </label>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                 签单业务员<br>签单时间
              </label>
              <label class="layui-form-label" style="text-align:left;">
                  {:idToAdminname($clientInfo['baoA_aid'])}
                  <br>{$clientInfo.qiandan_time|date="Y-m-d ",###}
              </label>
          </div>
          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>回访信息</legend>
          </fieldset>
          <div class="layui-form-item">
              <label for="live_id" class="layui-form-label">
                  <span class="x-red">*</span>客户满意度
              </label>
              <label class="layui-form-label" style="width: 300px;text-align:left;">
                  <div id="score-div"></div>
              </label>
              <input type="hidden" value="" name="score" id="score" required="" lay-verify="required">
          </div>
          <div class="layui-form-item">
              <label for="company_name" class="layui-form-label">
                  <span class="x-red">*</span>详细评价
              </label>
              <div class="layui-input-block">
                <textarea placeholder="请输入内容" name="content" class="layui-textarea" required="" lay-verify="required"></textarea>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="company_name" class="layui-form-label">
                  <span class="x-red">*</span>建议及其他
              </label>
              <div class="layui-input-block">
                <textarea placeholder="请输入内容" name="other_content" class="layui-textarea" required="" lay-verify="required"></textarea>
              </div>
          </div>


          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                  提交
              </button>
          </div>
      </form>
    </div>
    <script>
        layui.use(['form','layer','laydate','upload','rate'], function(){
          $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer
          ,laydate = layui.laydate
          ,upload = layui.upload
          ,rate = layui.rate;


          rate.render({
            elem: '#score-div'
            
            
            ,text: true
            ,setText: function(value){ //自定义文本的回调
              var arrs = {
                '1': '非常不满意'
                ,'2': '不满意'
                ,'3': '一般'
                ,'4': '比较满意'
                ,'5': '非常满意'
              };
              this.span.text(arrs[value] || ( value + "星"));
            }
            ,choose: function(value){
              if(value > 0) 
                $('#score').val(value)
            }
          });

          //监听提交
          form.on('submit(add)', function(data){
            $.ajax({
                type:'POST',
                dataType:'json',
                data:{data:data.field},
                url:"{:url('admin/ClientReview/edit')}",
                success:function(obj){
                  layer.msg(obj.msg, {icon: obj.icon,time: 2000},function(){
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                    // 可以对父窗口进行刷新 
                    x_admin_father_reload();
                  });
                }
            });
            return false;
          });

        });
    </script>
  </body>

</html>